<?php
class VerifyPkgRepeatHandler extends Fs2PreHandler
{

    /**
     * @see SzAbstractCtrlPreProcessHandler::handle
     *
     * @param array $inputs passed by reference, params inputted from $_REQUEST['*']
     * @return boolean
     */
    public function handle(&$inputs)
    {
        if ($this->checkHandleExclude($inputs)) {
            return true;
        }

        $pkgIndex = SzParam::getReqParam('pkgIndex', 0);
        if ($pkgIndex == 0) {
            return true;
        }

        $userId = $this->parseUserId($inputs);
        $resManager = unserialize(SzContextFactory::get()->getStaticCache($userId)->hGet(GameConst::CACHE_KEY_PKG_INDEX . $userId, $pkgIndex));

        if ($resManager) {
            $resManager->send();
            exit;
        }
        return true;
    }
}